<template>
  <base-option :selected="selected" :field-config="fieldConfig" :form-config="formConfig">
    <template #default="{ hideOptions }">
      <el-form-item v-if="fieldConfig.direction !== undefined && hideOptions('direction')" label="分割线的方向">
        <el-select v-model="fieldConfig.direction" placeholder="">
          <el-option label="横向" value="horizontal" />
          <el-option label="垂直" value="vertical" />
        </el-select>
      </el-form-item>
      <el-form-item v-if="fieldConfig.title !== undefined && hideOptions('title')" label="分割线的标题">
        <el-input v-model="fieldConfig.title" maxlength="20" />
      </el-form-item>
      <el-form-item v-if="fieldConfig.titlePosition !== undefined && hideOptions('titlePosition')" label="标题位置">
        <el-select v-model="fieldConfig.titlePosition" placeholder="">
          <el-option label="左侧显示" value="left" />
          <el-option label="居中显示" value="center" />
          <el-option label="右侧显示" value="right" />
        </el-select>
      </el-form-item>
      <el-form-item v-if="fieldConfig.lineStyle !== undefined && hideOptions('lineStyle')" label="分割线的样式">
        <el-select v-model="fieldConfig.lineStyle" placeholder="">
          <el-option label="虚线" value="dashed" />
          <el-option label="实线" value="solid" />
        </el-select>
      </el-form-item>
    </template>
    <template #base-advanced><div></div></template>
  </base-option>
</template>

<script setup>
import { toRefs } from 'vue'
import baseOption from './base-option.vue'
import propsDefinition from './props'
const props = defineProps(propsDefinition)
const { selected, fieldConfig, formConfig } = toRefs(props)
</script>
